﻿using Domain.Infrastructure;

namespace Application.Infrastructure
{
    /// <summary>
    /// 具有（创建）约束的 服务基类
    /// </summary>
    /// <typeparam name="T"></typeparam>
    public class BaseService_C<T> : BaseService<T> where T : class, ICreationAudited, new()
    {
        public BaseService_C()
        {
        }
        public BaseService_C(ILog log, IRepositoryBase<T> repository, string userId) : base(log, repository, userId)
        {
        }
        public override bool Insert(T entity)
        {
            entity.Create(UserId);
            return Repository.Insert(entity);
        }



    }
}
